package com.gxa.service.impl;

import com.gxa.dto.ApplyAddDto;
import com.gxa.dto.GoodsDetailsDto;
import com.gxa.entity.GoodsDetail;
import com.gxa.mapper.GoodsDetailMapper;
import com.gxa.service.GoodsDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
public class GoodsDetailServiceImpl implements GoodsDetailService {
//    @Override
//    public GoodsDetailService queryById(Integer did) {  //根据id查询
//
//        return null;
//    }
//
//    @Override
//    public void add(GoodsDetailService goodsDetail) { //添加
//
//    }
    @Autowired
   private GoodsDetailMapper goodsDetailMapper;
    @Override
    public
    List<GoodsDetail> queryAll(GoodsDetailsDto goodsDetailsDto) {
        List<GoodsDetail> goodsDetails = goodsDetailMapper.queryAll(goodsDetailsDto);
        return goodsDetails;

    }



  public   List<GoodsDetail> queryGoods() {
      List<GoodsDetail> goodsDetails = goodsDetailMapper.queryGoods();
      return goodsDetails;

  }

    @Override
    public
    List<GoodsDetail> queryByGId() {
        List<GoodsDetail> goodsDetails = this.goodsDetailMapper.queryByGId();
        return goodsDetails;
    }

    @Override
    public void add(GoodsDetailService goodsDetail) {

    }

    @Override
    public List<GoodsDetailsDto> selGoods(Integer id) {

        List<GoodsDetailsDto> goods = this.goodsDetailMapper.selGoods(id);
        return goods;
    }


    @Override
    public List<GoodsDetailsDto> queryGoodsDetail(Integer sid) {

        String s = this.goodsDetailMapper.selGoodsDetailId(sid);

        String[] split = s.split(",");

        List<GoodsDetailsDto> goodsDetailsDtos = this.goodsDetailMapper.selGoodsDetail(split);


        return goodsDetailsDtos;
    }

}